<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>基于vue的数据驱动</title>
</head>

<body>
    <div id="smartParty">
        <h1>{{a}}</h1>
        <button @click="add">点我加1</button>
        <button @click="minus">点我减1</button>
    </div>
    <script src="js/vue2.js"></script>
    <script>
        new Vue({
            //挂载点
            el: '#smartParty',
            data: {
                a: 100
            },
            methods: {
                add() {
                    this.a++
                },
                minus() {
                    this.a--
                }
            }
        });
    </script>
</body>

</html>